/**
 * Created by yyj on 2015/10/28.
 */
var $path=$("#webPath").val();
$(function(){
	 initCheckdata();
	 initButton();
    //点击关闭按钮
   
});

function initButton(){
	    $('.press_btn2.Close').click(function(){
	        var index = parent.layer.getFrameIndex(window.name);
	        parent.layer.close(index);
	    });
	    
	    $('.press_btn1').click(function(){
	    	save();
	    });
}


function save(){
	if(!checkData()) return;
	var editflag = $("#editflag").val().trim();
	var linkmanid = $("#linkmanid").val().trim();
	var linkmanName = $("#linkmanName").val().trim();
	var mobilePhone = $("#mobilePhone").val().trim();
	var email = $("#email").val().trim();
	var department = $("#department").val().trim();
	var pany = $("#pany").val().trim();
	$.ajax({
		url : basePath+"/radar/config/savelinkman.do",
		type: "POST",
		dataType:"json",
		data : {
			"thirdPartyLinkmansId":linkmanid,
			"linkmanName":linkmanName,
			"mobilePhone":mobilePhone,
			"email":email,
			"department":department,
			"pany":pany,
			"editflag":editflag
		},
		success:function(data){
			if(data.errorMessage == ""){
				layer.msg('保存成功！', {icon : 1});
				parent.reQuery('linkman');
				closeWindow();
			}
		}
	});
}